package com.qst.crop.demo.service;


import com.qst.crop.demo.entity.Answer;
import com.qst.crop.demo.entity.Question;
import com.qst.crop.demo.mapper.AnsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class AnsService {
    @Autowired
    AnsMapper ansMapper;

    public Integer add(String responder, String answerText, long questionId, Date createdDate){
        return ansMapper.add(responder, answerText, questionId, createdDate);
    }

    public Integer deleteById(long answerId){
        return ansMapper.deleteById(answerId);
    }

    public Answer getAnsById(long answerId){
        return ansMapper.getAnsById(answerId);
    }

    public List<Answer> select(String searchWord){
        return ansMapper.select(searchWord);
    }

    public List<Answer> getAnsList(long questionId){
        return ansMapper.getAnsList(questionId);
    }
}
